package com.aw.qzblog.common;

import com.aw.qzblog.exception.SysException;
import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class Result {
    private int code;
    private String msg;
    private Object data;


    public static Result fail(SysException e) {
        return new Result(e.getCode(), e.getMsg(), null);
    }

    public static Result success() {
        return new Result(200, "success", null);
    }

    public static Result success(Object data) {
        return new Result(200, "success", data);
    }
}

